<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('order/index')}">订单管理</a></li>
        <li class="active"><a href="#A" data-toggle="tab">查看物流</a></li>
    </ul>
    
    <div class="well form-inline margin-top-20">
        <div>
            <span style="font-size: 20px;">物流信息</span>
        </div>
        <hr style="background: black">
       <div style="margin-top: 20px;margin-left: 10px;font-size: 16px;">
       订单号：<span>{$data.order_no}</span>   
       <br>
       <br>
       物流单号：<span>{$data.express_no}</span>
       <br>
       <br>
       物流公司：<span>{$data.express_company}</span>
       <br>
       <br>
       物流状态：<span>{$data.status}</span>
       <br>
       <br>
       </div>
       <hr style="background: black">
       <div>
            <span style="font-size: 20px;">物流跟踪</span>
        </div>
        <hr style="background: black">
        <div style="margin-top: 20px;margin-left: 10px;font-size: 16px;">
        <?php if($info == 0){ ?>
        <div>该订单商品没有物流信息</div>
        <?php }else{ foreach($info['list'] as $k => $v){?>
        <div>
         <p><?php echo $v['time']; ?></p>
         <p><?php echo $v['content']; ?></p>
         </div>
         <br>
        <?php }} ?>
    </div>
       
    
<br>
<a class="btn btn-primary" href="{:url('Order/index')}" style="margin-left: 100px;">确定</a>


</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    $("#submit").click(function(){
        var express_no = $("#express_no").val();
        var express_company = $("#express_company").val();
        var order_id = $("#order_id").val();
        if(express_no == ''){
            alert('物流单号不能为空！')
            return false;
        }
        if(express_company == ''){
            alert('物流公司不能为空！')
            return false;
        }
        $.ajax({
            type: "POST",
            url: "shipments",
            data: {"express_no":express_no,'express_company':express_company,'order_id':order_id},
            dataType: "json",
            success: function(data){
                if(data.code ==1 ){
                   alert(data.msg);
                   window.location.href="/admin/order/index"
                   return
                }else{
                    alert(data.msg);
                }
            }        
        });
    })
</script>
</body>
</html>
